using FileServer.Abstractions.Models.Options;
using FileServer.Storage.MySql;

namespace Aurora.TaskScheduler.Storage.MySql;

public static class FileMysqlExtension
{
    /// <summary>
    /// 使用mysql 
    /// </summary>
    /// <param name="options"></param>
    /// <param name="configure"></param>
    /// <returns></returns>
    public static FileServerOptions UseMySql(this FileServerOptions options, Action<MySqlOptions> configure)
    {
        if (configure == null) throw new ArgumentNullException(nameof(configure));
        options.RegisterExtension(new MySqlFileServerOptionExtension(configure));
        return options;
    }
}